<?php
/**
 * H5UrlConstant.php
 *
 * @author camfee <camfee@foxmail.com>
 * @date   17-9-8 下午7:39
 *
 */

namespace Constants;


class H5UrlConstant
{
    //根据情况修改
    public static $protocol = 'http';

    const MEITE_URI = '/meite.php';                     //免费领取首页
    const PROFILE_URI = '/meite.php?do=Profile';        //填写地址信息
    const PAYMENT_URI = '/meite.php?do=Payment';        //支付首页
    const PAYMENT_OK_URI = '/meite.php?do=PaymentOk';   //支付完成
    const PARAM_URI = '/meite.php?do=Param';            //美特体脂秤规格参数
    const EXPRESS_URI = '/express.php';                 //物流信息首页
    const FAQ_URI = '/app/help/FAQ.php';              //常见问题h5
    const FEEDBACK_URL = '/app/help/feedback.php';    //意见反馈h5
    const HEALTH_URL = '/app/help/health.php';        //接入苹果健康h5
    const JOINED_HEALTH_URL = '/app/help/health.php?a=1';     //已接入苹果健康H5
    const MEITE_HELP_URL = '/app/help/meite.php';     //玩转美特h5
    const PRIVACY_URL = '/app/help/privacy.php';      //隐私条款h5
    const ASSISTANT_URL = '/app/help/assistant.php';  //特卖省钱助手
    const INDICATOR_URL = '/app/help/indicator.php';  //身体指标说明
    const CHANGE_MEMBER_URL = '/app/help/change.php'; //切换成员
    const LOOK_HELP_URL = '/app/help/look.php';       // 查看帮助页

    public static function getMeiteUrl($reqLogin = true)
    {
        if ($reqLogin) {
            return SchemeConstant::getH5Scheme(self::getH5Url(self::MEITE_URI) . '?reqlogin=1');
        } else {
            return self::getH5Url(self::MEITE_URI);
        }
    }

    public static function getH5Url($uri, $host = CURRENT_M_HOST)
    {
        return autohost(static::$protocol . '://' . $host . $uri);
    }
}